Skip to content

fix: expose update_cache_when_empty builder option#331

Open
Sunrisea wants to merge 1 commit into
nacos-group:masterfrom
Sunrisea:fix/issue-15419-update-cache-builder
Open

fix: expose update_cache_when_empty builder option#331
Sunrisea wants to merge 1 commit into
nacos-group:masterfrom
Sunrisea:fix/issue-15419-update-cache-builder

Conversation

@Sunrisea

@Sunrisea Sunrisea commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Expose ClientConfig.update_cache_when_empty through ClientConfigBuilder.update_cache_when_empty(...).
  • Keep the existing default behavior unchanged.
  • Add unit tests for the default value, configured value, and builder chaining.

Test plan

  • ./.venv/bin/python -m unittest test.test_client_config_builder -v
  • ./.venv/bin/python -m compileall v2/nacos/common/client_config_builder.py test/test_client_config_builder.py
  • ./.venv/bin/python -m unittest test.test_client_config_builder test.test_naming_service_cache -v
  • Local Nacos smoke test: default update_cache_when_empty=False does not receive the empty callback after the last instance is deregistered; .update_cache_when_empty(True) receives [].

Related to alibaba/nacos#15419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant